﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 股票数据;

namespace StockDataBase.DataOperation
{
    public class NewsDataOp : DatabaseOp
    {
        public NewsDataOp()
        {
            this.ConnectToDatabase(Utils.DB_PATH);
        }

        public void InsertItem(string uid, string datetime, string stockId, string title, string url)
        {
            uid = uid.Replace("'", "''");
            datetime = datetime.Replace("'", "''");
            stockId = stockId.Replace("'", "''");
            title = title.Replace("'", "''");
            url = url.Replace("'", "''");
            string sql = "replace into news(Uid,DateTime,StockId,Title,Url) values ('{0}','{1}','{2}','{3}','{4}')";
            sql = string.Format(sql, uid, datetime, stockId, title, url);
            this.ExcuteSql(sql);
        }

    }

}
